/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */

package com.windea.study.kotlin.fxgl.sample.sandbox.cutscene

import com.almasb.fxgl.app.*
import com.almasb.fxgl.cutscene.*
import com.almasb.fxgl.dsl.*
import com.almasb.fxgl.dsl.FXGL.Companion.getCutsceneService
import javafx.scene.input.*
import javafx.scene.paint.*

/**
 * @author Almas Baimagambetov (almaslvl@gmail.com)
 */
class CutsceneSample : GameApplication() {
	override fun initSettings(settings: GameSettings) {
		settings.width = 1280
		settings.height = 720
	}
	
	override fun initInput() {
		onKeyDown(KeyCode.F, "test") {
			val lines = getAssetLoader().loadText("cutscene0.txt")
			
			val cutscene = Cutscene(lines)
			
			getCutsceneService().startCutscene(cutscene)
			
			//val scene = CutsceneScene ();
			//scene.start(cutscene);
			//
			//getGameController().pushSubScene(scene);
		}
	}
	
	override fun initGame() {
		getGameScene().setBackgroundColor(Color.BLUE)
	}
}


fun main(args: Array<String>) {
	GameApplication.launch(CutsceneSample::class.java, args)
}
